<template>
	<view class="content">
		<image class="logo" src="/static/logo.png"></image>
		<button @click="handleJumpSetting">跳转设置</button>
		<button @click="handleOpenHuaweiMarket">打开应用市场</button>
		<button @click="handleClearCache">清除缓存{{cacheSize}}</button>
		<button @click="handlelaunchMiniProgram">打开微信小程序</button>
		<button @click="handletextshare">文本分享</button>
		<button @click="handleimageshare">图片分享</button>
	</view>
</template>

<script lang="uts" setup>
import { onBeforeMount, onMounted, ref } from 'vue';
import { calcCache, clearCache, imageshare, jumpSetting, launchMiniProgram, openHuaweiAppMarket, textshare, windowUtil } from '@/uni_modules/fer-api';

	onBeforeMount(()=>{
		console.log('12138')
		windowUtil()
		
	})
	onMounted(()=>{
		handleGetCache()
	})
	
	const cacheSize = ref('')
	function handleJumpSetting() {
	  jumpSetting()
	}
	function handleOpenHuaweiMarket() {
	  openHuaweiAppMarket()
	}
	async function handleGetCache() {
	  cacheSize.value = await calcCache()

	}
	
	function handleClearCache() {
	  clearCache()
	  cacheSize.value = '0MB'
	}
	function handlelaunchMiniProgram(){
		launchMiniProgram()
	}
	function handletextshare(){
		textshare()
	}
	function handleimageshare(){
		imageshare()
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>
